package ninth.线程操作案例.问题解决1_加入同步;
  class Producer1 implements Runnable{
    private Info info;
    public Producer1(Info info){
        this.info=info;
    }

    @Override
    public void run() {
        boolean flag = false;
        for (int i = 0; i < 50; i++) {
            if(flag){
                this.info.set("王境泽","啊~真香");
                flag=false;
            }else{
                this.info.set("王傲娇","我今天就是饿死也不吃一口饭");
                flag=true;
            }
        }
    }
}
public class 修改生产者 {
}
